<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Cesium Hello World</title>
    <script src="https://cesium.com/downloads/cesiumjs/releases/1.94/Build/Cesium/Cesium.js"></script>
    <link href="https://cesium.com/downloads/cesiumjs/releases/1.94/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
    <style>
        @import url(https://cesium.com/downloads/cesiumjs/releases/1.94/Build/Cesium/Widgets/widgets.css);

        html, body, #cesiumContainer {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
    </style>
</head>
<body>
<div id="cesiumContainer"></div>
<script>
    // 初始化Cesium Viewer在之前定义的div容器内
    const KEY = "4caf91d8465b13654a44b4f71c35e7e0";
    const viewer = new Cesium.Viewer('cesiumContainer', {
        // imageryProvider: false,
        imageryProvider: new Cesium.WebMapTileServiceImageryProvider({
            url: 'http://t0.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&format=tiles&style=default&tk=' + KEY,
            layer: 'tdtImgLayer',
            style: 'default',
            format: 'image/jpeg',
            tileMatrixSetID: 'GoogleMapsCompatible', // 使用WGS84地理坐标系统
            show: true
        }),
        baseLayerPicker: false,
    });

    viewer.camera.flyTo(Cesium.Cartesian3.fromDegrees(116.397477, 39.908692, 1000))

    // viewer.camera.flyTo({
    //     destination: Cesium.Cartesian3.fromDegrees(116.397477, 39.908692, 1000),
    //     // orientation: {
    //     //     heading: Cesium.Math.toRadians(heading), // 默认值为0
    //     //     pitch: Cesium.Math.toRadians(pitch),     // 默认值为-Cesium.Math.PI_OVER_TWO
    //     //     roll: 0                                   // 默认值为0
    //     // },
    //     duration: 2000, // 可选，飞行持续时间，默认根据距离自动计算
    //     complete: function() { /* 飞行完成后执行 */ }, // 可选，回调函数
    //     cancel: function() { /* 飞行取消时执行 */ }   // 可选，回调函数
    // });
</script>
</body>
</html>